<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<c:set var="root" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Lowin</title>
    <link rel="stylesheet" href="${root}/static/css/auth.css">
</head>

<body>
<div class="lowin">
    <div class="lowin-brand">
        <img src="${root}/static/image/kodinger.jpg" alt="logo">
    </div>
    <div class="lowin-wrapper">
        <div class="lowin-box lowin-register">
            <div class="lowin-box-inner">
                <form  action="${root}/register" id="registerform" method="post">
                    <p>创建您的账户</p>
                    <div class="lowin-group">
                        <label>姓名</label><span style="color: red;">${msg}</span>
                        <%--<p id="name_msg"></p>--%>
                        <input type="text" id="username" name="username" autocomplete="name" class="lowin-input">
                    </div>
                    <div class="lowin-group">
                        <label>密码</label>
                        <input type="password" name="password" autocomplete="current-password" class="lowin-input">
                    </div>
                    <div class="lowin-group">
                        <label>确认密码</label><span style="color: red;">${rep}</span>
                        <input type="password" name="repassword" autocomplete="current-repassword" class="lowin-input">
                    </div>
                    <button  class="lowin-btn" >
                        注册
                    </button>

                    <div class="text-foot">
                        已经有账号? <a href="${root}/loginUI" class="login-link">登录</a>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <footer class="lowin-footer">
        Design By @itskodinger. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
    </footer>
</div>

<script src="${root}/static/js/auth.js"></script>
<script src="${root}/static/jquery/jquery-2.2.4.min.js"></script>
<script>
    Auth.init({
        <%--login_url: '${root}/register',--%>
        forgot_url: '#forgot'
    });
//    function user_register() {
//        $("#registerform").submit();
//    }
    <%--function check_name() {--%>
        <%--var username = $("#username").val();--%>
        <%--var name_msg = $("#name_msg");--%>
        <%--$.ajax({--%>
            <%--url:"${root}/check",--%>
            <%--type:"POST",--%>
            <%--data:"username="+username,--%>
            <%--error:function (data) {--%>
            <%--},--%>
            <%--success:function (data) {--%>
                <%--if (data == "true")--%>
                <%--{--%>
                    <%--name_msg.html("可以注册");--%>
                    <%--name_msg.css({"color":"green"});--%>
                <%--}else {--%>
                    <%--name_msg.html("不可以注册");--%>
                    <%--name_msg.css({"color":"red"});--%>
                <%--}--%>
            <%--}--%>
        <%--})--%>
    <%--}--%>
    <%--function json_check() {--%>
        <%--var username = $("#username").val();--%>
        <%--var name_msg = $("#name_msg");--%>
        <%--$.ajax({--%>
            <%--url:"${root}/JsonCheck",--%>
            <%--type: "POST",--%>
            <%--contentType:"application/json",--%>
            <%--data:JSON.stringify({username:username}),--%>
            <%--dataType:"json",--%>
            <%--success:function (data) {--%>
                <%--if (data.msg == "true")--%>
                <%--{--%>
                    <%--name_msg.html("可以注册");--%>
                    <%--name_msg.css({"color":"green"});--%>
                <%--}else {--%>
                    <%--name_msg.html("不可以注册");--%>
                    <%--name_msg.css({"color":"red"});--%>
                <%--}--%>
            <%--}--%>
        <%--})--%>
    }
</script>
</body>
</html>